from django.conf.urls import url,include
from myadmin.views import index,users,types,goods,orders

urlpatterns = [
    url(r'^$', index.index,name='myadmin_index'),# 后台首页

    # 会员管理
    url(r'^users/(?P<page>[0-9]+)$',users.index,name='myadmin_users_index'),
    url(r'^users/add$',users.add,name='myadmin_users_add'),
    url(r'^users/insert$',users.insert,name='myadmin_users_insert'),
    url(r'^users/del/(?P<uid>[0-9]+)$',users.delete,name='myadmin_users_del'),
    url(r'^users/edit/(?P<uid>[0-9]+)$',users.edit,name='myadmin_users_edit'),
    url(r'^users/update/(?P<uid>[0-9]+)$',users.update,name='myadmin_users_update'),
    url(r'^users/pwd/(?P<uid>[0-9]+)$',users.pwd,name='myadmin_users_pwd'),# 重置密码
    url(r'^users/pwdSave/(?P<uid>[0-9]+)$',users.pwdSave,name='myadmin_users_pwdSave'),
    # 登陆
    url(r'^login$',index.login,name='myadmin_login'),
    url(r'^dologin$',index.dologin,name='myadmin_dologin'),
    url(r'^logout$',index.logout,name='myadmin_logout'),
    url(r'^verify$',index.verify,name='myadmin_verify'),

    # 商品类别
    url(r'^types$',types.index,name='myadmin_types_index'),
    url(r'^types/add/(?P<tid>[0-9]+)$',types.add,name='myadmin_types_add'),
    url(r'^types/insert$',types.insert,name='myadmin_types_insert'),
    url(r'^types/del/(?P<tid>[0-9]+)$',types.delete,name='myadmin_types_del'),
    url(r'^types/edit/(?P<tid>[0-9]+)$',types.edit,name='myadmin_types_edit'),
    url(r'^types/update/(?P<tid>[0-9]+)$',types.update,name='myadmin_types_update'),
    # 商品管理
    url(r'^goods/(?P<page>[0-9]+)$', goods.index, name='myadmin_goods_index'),
    url(r'^goods/add$', goods.add, name='myadmin_goods_add'),
    url(r'^goods/insert$', goods.insert, name='myadmin_goods_insert'),
    url(r'^goods/del/(?P<gid>[0-9]+)$', goods.delete, name='myadmin_goods_del'),
    url(r'^goods/edit/(?P<gid>[0-9]+)$', goods.edit, name='myadmin_goods_edit'),
    url(r'^goods/update/(?P<gid>[0-9]+)$', goods.update, name='myadmin_goods_update'),
    # 订单管理
    url(r'^orders$', orders.index, name="myadmin_orders_index"),
    url(r'^orders/(?P<pIndex>[0-9]+)$', orders.index, name="myadmin_orders_index"),
    url(r'^orders/detail/(?P<oid>[0-9]+)$', orders.detail, name="myadmin_orders_detail"),
    url(r'^orders/state$',orders.state, name="myadmin_orders_state"),

]
